package top.gxw.routelearn.view.activity

import android.os.Bundle
import android.util.Log
import com.alibaba.android.arouter.facade.annotation.Autowired
import com.alibaba.android.arouter.facade.annotation.Route
import kotlinx.android.synthetic.main.activity_second.*
import top.gxw.routelearn.R
import top.gxw.routelearn.base.BaseActivity
import top.gxw.routelearn.base.Constance
import top.gxw.routelearn.model.Dog
import top.gxw.routelearn.model.User

@Route(path = Constance.ACTIVITY_URL_SECOND)
class SecondActivity : BaseActivity() {
    /**
     * 在这里不能使用private修饰，可以使用
     */
    @JvmField
    @Autowired(name = "from", required = true)
    var from: String? = null

    @JvmField
    @Autowired
    var user: User? = null

    /**
     * 如果不序列化或者Serializable,并且需要传递该类，则需要新建JsonServiceImpl，然后实现 SerializationService
//     */
    @JvmField
    @Autowired
    public var dog: Dog? = null


    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_second)
        //        Intent intent = getIntent();
//        if (intent.hasExtra("from")) {
//            String from = intent.getStringExtra("from");
//            Log.e("GXW", "from===========" + from);
//        }
//        tv_sec = findViewById(R.id.tv_sec)
//        tv_sec.text =

//        tv_thr

        tv_sec.text = from
        Log.e("GXW", "user->10=======" + user.toString())
        Log.e("GXW", "dog->10=======" + dog.toString())
    }
}